Histogram Model: Color and Position Features


Sergei Papulin (papulin.edu@gmail.com)

Contents

Creating virtual environment

This is an optional step. You can skip it and install packages to your current environment.

python -m venv .venv/histtest
source .venv/histtest/bin/activate
pip install \
    numpy==1.19.5 \
    plotly==5.5.0 \
    jupyter==1.0.0 \
    pillow==5.4.1 \
    scikit-image==0.14.2 \
    pycocotools==2.0.3 \
    himpy=0.0.1

Load packages

Generating Images

Defining Color Elements

Low-Level Elements

Stucture of color elements:

[
    {
        "id": id,
        "h": [min, max],
        "s": [min, max],
        "b": [min, max]
    }, ...
]

Parameters:

High-Level Elements

Defining Positional Elements

Low-Level Elements

High-Level Elements

Creating Histogram

Querying

Operations on Histogram Elements

Example for Union

Other operations

Image Retrieval

Expression as query

Image sample as query

References